package com.bangcommunity.bbframe.mlog.collector;

import com.bangcommunity.bbframe.common.base.MainConfigLoader;

import java.io.Serializable;

/**
 * @author tanghc
 * @date 18/1/30
 */
public class StatisticBaseBean implements Serializable {
    private static final long serialVersionUID = 8802224277521177531L;
    protected String productCode = MainConfigLoader.getInstance().getProductCode();
    protected String appCode = MainConfigLoader.getInstance().getAppCode();
    private String mkey;
    /** 耗时,单位毫秒 */
    private long elapsedMs;
    /** 成功次数 */
    private long succ;
    /** 失败次数 */
    private long fail;
    /** 异常次数 */
    private long exception;
    /** 并发个数 */
    private long concurrent;

    public StatisticBaseBean(String mkey) {
        this.mkey = mkey;
    }

    public long getElapsedMs() {
        return elapsedMs;
    }

    public void setElapsedMs(long elapsedMs) {
        this.elapsedMs = elapsedMs;
    }

    public long getSucc() {
        return succ;
    }

    public void setSucc(long succ) {
        this.succ = succ;
    }

    public long getFail() {
        return fail;
    }

    public void setFail(long fail) {
        this.fail = fail;
    }

    public long getException() {
        return exception;
    }

    public void setException(long exception) {
        this.exception = exception;
    }

    public long getConcurrent() {
        return concurrent;
    }

    public void setConcurrent(long concurrent) {
        this.concurrent = concurrent;
    }

    public long getTransactions() {
        return this.succ + this.fail + this.exception;
    }

    public String getMkey() {
        return mkey;
    }

    public void setMkey(String mkey) {
        this.mkey = mkey;
    }
}
